<!DOCTYPE html> 
<?php
include './lib/Banco.php';
include './lib/info_logado.php';
include './Funcoes.php';
$query = "SELECT * FROM fatura WHERE Usuario_IDusuario=$ID_usuario";
$resultquery = mysqli_query($conn, $query); { 
}
?>

<html>

    <head>
        <title>AFACT - <?= $nome ?></title>
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <script type="text/javascript" src="js/modernizr-1.5.min.js"></script>
    </head>

    <body>
        <div id="main">
            <header>
                <div id="header_section">	  
                    <div id="welcome">
                        <h2>AFACT</h2>
                    </div><!--close welcome-->			  	
                    <nav>
                        <ul id="nav">
                            <li><a href="index.php"><?= $nome ?></a></li>
                            <li class="current"><a href="meuspdfs.php">Meus PDFs</a></li>
                            <li><a href="grafico.php">Gráfico</a></li>
                            <li><a href="logout.php">Sair</a></li>
                        </ul>
                    </nav>
                </div>		
            </header>

            <div id="site_content">				

                <div id="content">
                    <div class="content_imagetext">
                        <table border="1">
                            <thead>
                            <th>ID</th>
                            <th>Valor</th>
                            <th>Nome Conta</th>
                            <th>Data_Venc</th>
                            <th>N&uacute;mero</th>
                            <th>Baixar</th>
                            </thead>
                            <?php while ($row = mysqli_fetch_array($resultquery, MYSQLI_ASSOC)): ?>
                                <tr>
                                    <td>&nbsp;&nbsp;<?= $row["idFatura"]; ?>&nbsp;&nbsp;&nbsp;</td>
                                    <td>&nbsp;&nbsp;<?= $row["ValorTotal"]; ?> &nbsp;&nbsp;&nbsp; </td>
                                    <td>&nbsp;&nbsp;<?= $row["Nome Cliente"]; ?> &nbsp;&nbsp;&nbsp; </td>
                                    <td>&nbsp;&nbsp;<?= $row["Dat_Vencimento"]; ?>&nbsp;&nbsp;&nbsp;  </td>
                                    <td>&nbsp;&nbsp;<?= $row["Numero"]; ?>&nbsp;&nbsp;&nbsp;</td>
                                    <td>&nbsp;&nbsp;<?="<a href='DownloadFatura.php?nome={$row["nomeArquivo"]}'>Download</a>"?></td>
                                </tr>
                            <?php endwhile; ?>
                        </table>
                    </div>
                    <?php imprimeLateral() ?>

                </div><!--close content--> 

            </div><!--close site_content-->  	

            <footer>
                <a href="index.html"><?= $nome ?></a> | <a href="meuspdfs.php">Meus PDFs</a> | <a href="grafico.php">Gr&aacute;fico</a>
            </footer> 	

        </div><!--close main-->
    </body>
</html>
